package List.set;

import java.util.HashSet;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/5/4
 * //练习1.求一个字符串"aiodjl;hriWFUADJSV123UEHiowfjnivowe"中一共有几个不重复的字母,区分大小写,如a,A算两个字符
 */
public class Test01 {
    public static void main(String[] args) {
        String s = "aiodjl;hriWFUADJSV123UEHiowfjnivowe";
        HashSet<Character> hs = new HashSet<>();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (Character.isLetter(c)) {
                hs.add(c);
            }
        }
        System.out.println("一共有 " + hs.size()+"不重复的字母");
    }
}
